<?php


namespace App\Transformers\System;


use App\Models\SystemRole;
use League\Fractal\TransformerAbstract;

class SystemRoleTransformer extends TransformerAbstract
{
    public function transform(SystemRole $data)
    {
        return [
            'id' => $data->id,
            'role_name' => $data->role_name ?? '',
            'rules' => $data->rules ?? '',
            'level' => $data->level ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
